#!/usr/bin/env bash

# Copyright 2014, Joyent Inc. All rights reserved
# For scripts that should be run on first boot only

# load common functions and vars
. /lib/smartdc/lib_smartdc_scripts.cfg

lib_smartdc_info "Start of $(basename $0) script"

# Set root password if root_pw is set in the image manifest
(/lib/smartdc/set-rootpassword)

# Set hostid
(/lib/smartdc/set-hostid)

# Format disk
(/lib/smartdc/format-secondary-disk)

# Disable firstboot once all scripts are run
lib_smartdc_info "Disabling firstboot"
touch /lib/smartdc/.firstboot-complete-do-not-delete

exit 0
